# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.DataLabeling.V1beta1.Model.GoogleCloudDatalabelingV1beta1Evaluation do
  @moduledoc """
  Describes an evaluation between a machine learning model's predictions and ground truth labels. Created when an EvaluationJob runs successfully.

  ## Attributes

  *   `annotationType` (*type:* `String.t`, *default:* `nil`) - Output only. Type of task that the model version being evaluated performs, as defined in the evaluationJobConfig.inputConfig.annotationType field of the evaluation job that created this evaluation.
  *   `config` (*type:* `GoogleApi.DataLabeling.V1beta1.Model.GoogleCloudDatalabelingV1beta1EvaluationConfig.t`, *default:* `nil`) - Output only. Options used in the evaluation job that created this evaluation.
  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Timestamp for when this evaluation was created.
  *   `evaluatedItemCount` (*type:* `String.t`, *default:* `nil`) - Output only. The number of items in the ground truth dataset that were used for this evaluation. Only populated when the evaulation is for certain AnnotationTypes.
  *   `evaluationJobRunTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Timestamp for when the evaluation job that created this evaluation ran.
  *   `evaluationMetrics` (*type:* `GoogleApi.DataLabeling.V1beta1.Model.GoogleCloudDatalabelingV1beta1EvaluationMetrics.t`, *default:* `nil`) - Output only. Metrics comparing predictions to ground truth labels.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. Resource name of an evaluation. The name has the following format: "projects/{project_id}/datasets/{dataset_id}/evaluations/ {evaluation_id}'
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :annotationType => String.t() | nil,
          :config =>
            GoogleApi.DataLabeling.V1beta1.Model.GoogleCloudDatalabelingV1beta1EvaluationConfig.t()
            | nil,
          :createTime => DateTime.t() | nil,
          :evaluatedItemCount => String.t() | nil,
          :evaluationJobRunTime => DateTime.t() | nil,
          :evaluationMetrics =>
            GoogleApi.DataLabeling.V1beta1.Model.GoogleCloudDatalabelingV1beta1EvaluationMetrics.t()
            | nil,
          :name => String.t() | nil
        }

  field(:annotationType)

  field(:config,
    as: GoogleApi.DataLabeling.V1beta1.Model.GoogleCloudDatalabelingV1beta1EvaluationConfig
  )

  field(:createTime, as: DateTime)
  field(:evaluatedItemCount)
  field(:evaluationJobRunTime, as: DateTime)

  field(:evaluationMetrics,
    as: GoogleApi.DataLabeling.V1beta1.Model.GoogleCloudDatalabelingV1beta1EvaluationMetrics
  )

  field(:name)
end

defimpl Poison.Decoder,
  for: GoogleApi.DataLabeling.V1beta1.Model.GoogleCloudDatalabelingV1beta1Evaluation do
  def decode(value, options) do
    GoogleApi.DataLabeling.V1beta1.Model.GoogleCloudDatalabelingV1beta1Evaluation.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.DataLabeling.V1beta1.Model.GoogleCloudDatalabelingV1beta1Evaluation do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
